Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AG-1328: improve handling of target nominations table display strings #1302

Merged
merged 3 commits into from
May 14, 2024

Conversation

hallieswan
Copy link
Contributor

  • drop null study values from display string
  • include all values from comma separated strings

Comment on lines +43 to +64
const setUp = (genes: Gene[]) => {
const genesResponse: GenesResponse = {
items: genes
};
mockApiService = TestBed.inject(ApiService);
spyOn(mockApiService, 'getNominatedGenes').and.returnValue(
of(genesResponse)
);
fixture.detectChanges();
element = fixture.nativeElement;

expect(mockApiService.getNominatedGenes).toHaveBeenCalled();

const table = element.querySelector('table');
expect(table).not.toBeNull();

const rows = Array.from(
table?.querySelectorAll('tbody tr') || []
) as HTMLTableRowElement[];

return { rows };
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create setUp method so that each test can specify which genes should be returned by the mock API service

);
studyArray = de.target_nominations
.map((nt: TargetNomination) => nt.study)
.filter((item) => Boolean(item)) as string[];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix for AG-1328 -- drop study values that are null or empty strings. See Cohort Study column below.

develop:
AG-1328_study_develop

feature:
AG-1328_study_feature

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a suggestion, perhaps we can create a helper method to remove null/empty values .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in the next commit

@hallieswan hallieswan marked this pull request as ready for review April 25, 2024 17:36
@hallieswan hallieswan requested a review from sagely1 April 25, 2024 17:36

return array;
formatDisplayValue(inputArray: string[]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a suggestion, perhaps we can rename this to getCommaSeparatedString() or something similar to be a bit more descriptive.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, done in next commit!

@hallieswan hallieswan requested a review from sagely1 May 13, 2024 20:55
@hallieswan hallieswan merged commit e7bf92e into Sage-Bionetworks:develop May 14, 2024
3 checks passed
@hallieswan hallieswan deleted the AG-1328 branch May 14, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants